dnd: Pass content to gdk_drag_begin()
authorBenjamin Otte <otte@redhat.com>
Wed, 13 Dec 2017 14:03:53 +0000 (15:03 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 13 Dec 2017 14:05:27 +0000 (15:05 +0100)
commit8648d5409ea53ef4bb6ad9b7940c32d663af41e5
treeff4d72ef4a6fd0fab462918a6b4896a884841a2a
parentc30cd885dd03d745bcb73a2bc5d20129e5cb6e36
dnd: Pass content to gdk_drag_begin()

Instead of just passing the GdkContentFormats, we are now passing the
GdkContentProvider to gdk_drag_begin().
This means that GDK itself can now query the data from the provider
directly instead of having to send selection events.

Use this to provide the private API gdk_drag_context_write() that allows
backends to pass an output stream that this data will be written to.
Implement this as the mechanism for providing drag data on Wayland.

And to make this all work, implement a content provider named
GtkDragContent that is implemented by reverting to the old DND
drag-data-get machinery inside GTK, so for widgets everything works just
like before.
13 files changed:
gdk/broadway/gdkdnd-broadway.c
gdk/broadway/gdkprivate-broadway.h
gdk/gdkdnd.c
gdk/gdkdnd.h
gdk/gdkdndprivate.h
gdk/gdkwindow.c
gdk/gdkwindowimpl.h
gdk/wayland/gdkdnd-wayland.c
gdk/wayland/gdkprivate-wayland.h
gdk/wayland/gdkselection-wayland.c
gdk/x11/gdkdnd-x11.c
gdk/x11/gdkprivate-x11.h
gtk/gtkdnd.c